<link rel="stylesheet" type="text/css" href="css/accourt.css"/>
<link rel="stylesheet" href="css/trecord.css" media="all" />
<link rel="stylesheet" href="css/page.css" media="all" />
<script type="text/javascript" src="js/Calendar.js"></script>
<script type="text/javascript" src="js/global/Date_func.js"></script>
<div class="r_content">
	<?include("account_bar.tpl")?>
	<div class="accoinfo accos">
		<form id="searchBox">
			<input type="hidden" name="timeT" id="timeT" value=""/>
			<input type="hidden" name="dtype" id="dtype" value="<?=$_REQUEST['dtype']?>"/>
			<input type="hidden" name="daction" id="daction" value="<?=$_REQUEST['daction']?>"/>
			<input type="hidden" name="about" id="about" value="<?=$about?>"/>
			<input type="hidden" name="account" id="account" value="<?=$_REQUEST['account']?>"/>
			<ul class="search">
				<li class="time">
					<span>起止日期：</span>
					<input type="text" name="beginDate" id="begintime" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$_REQUEST['beginDate']?>"/>
					<label>至</label>
					<input type="text" name="endDate"  id="endtime" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)" value="<?=$_REQUEST['endDate']?>"/>
					<a title="today" class="<?=$_REQUEST['timeT']=="today"?"current":""?>">今天</a>
					<a title="yesterday" class="<?=$_REQUEST['timeT']=="yesterday"?"current":""?>">昨天</a>
					<a title="week" class="<?=$_REQUEST['timeT']=="week"?"current":""?>">本周</a>
					<a title="lastweek" class="<?=$_REQUEST['timeT']=="lastweek"?"current":""?>">上周</a>
					<a title="month" class="<?=$_REQUEST['timeT']=="month"?"current":""?>">本月</a>
					<a title="lastmonth" class="<?=$_REQUEST['timeT']=="lastmonth"?"current":""?>">上月</a>
					<input type="submit" id="query" value="查询"/>
				</li>
				<li class="skey">
					<span>交易类型：</span>
					<a class="<?=!isset($_REQUEST['dtype'])||($_REQUEST['dtype']==="")?"current":""?>" key="dtype" kvalue="">全部</a>
					<a class="<?=$_REQUEST['dtype']==='0'?"current":""?>" key="dtype" kvalue="0">下单</a>
					<a class="<?=$_REQUEST['dtype']==='1'?"current":""?>" key="dtype" kvalue="1">撤改</a>
					<a class="<?=$_REQUEST['dtype']==='3'?"current":""?>" key="dtype" kvalue="3">充值/提现</a>
					<a class="<?=$_REQUEST['dtype']==='4'?"current":""?>" key="dtype" kvalue="4">授信/预存</a>
					<a class="<?=$_REQUEST['dtype']==='5'?"current":""?>" key="dtype" kvalue="5">分润</a>
					<a class="<?=$_REQUEST['dtype']==='6'?"current":""?>" key="dtype" kvalue="6">提现冻结</a>
				</li>
				<?if($_SESSION['dtype']==0){?>
				<li class="skey">
					<span>运营支付：</span>
					<a class="<?=!isset($_REQUEST['dtype'])||($_REQUEST['dtype']==="")?"current":""?>" key="dtype" kvalue="">全部</a>
					<a class="<?=$_REQUEST['dtype']==='7'?"current":""?>" key="dtype" kvalue="7">电子凭证费</a>
					<a class="<?=$_REQUEST['dtype']==='8'?"current":""?>" key="dtype" kvalue="8">短信费</a>
					<a class="<?=$_REQUEST['dtype']==='9'?"current":""?>" key="dtype" kvalue="9">交易手续费</a>
				</li>
				<?}?>
				<li class="skey">
					<span >收支情况：</span>
					<a class="<?=!isset($_REQUEST['daction'])||($_REQUEST['daction']==="")?"current":""?>" key="daction" kvalue="">全部</a>
					<a class="<?=$_REQUEST['daction']==='0'?"current":""?>" key="daction" kvalue="0">收入</a>
					<a class="<?=$_REQUEST['daction']=='1'?"current":""?>" key="daction" kvalue="1">支出</a>
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<span >交易账号：</span>
					<a class="<?=!isset($_REQUEST['account'])||($_REQUEST['account']==="")?"current":""?>" key="account" kvalue="">全部</a>
					<a class="<?=$_REQUEST['account']=='alipay'?"current":""?>" key="account" kvalue="alipay">支付宝</a>
					<a class="<?=$_REQUEST['account']=='pft'?"current":""?>" key="account" kvalue="pft">平台账户</a>
					<a class="<?=$_REQUEST['account']=='credit'?"current":""?>" key="account" kvalue="credit">授信账户</a>
					<a class="<?=$_REQUEST['account']=='creditSet'?"current":""?>" key="account" kvalue="creditSet">授信设置</a>
					<a class="<?=$_REQUEST['account']=='ipsPay'?"current":""?>" key="account" kvalue="ipsPay">网银</a>
				</li>
			</ul>
		</form>
	</div>
	<div class="acclist">
		<table class="acctab">
			<thead>
				<tr>
					<th class="tL">交易时间</th>
					<th>订单号</th>
					<th>交易内容</th>
					<th>交易方式</th>
					<th class="tR">收入</th>
					<th class="tR">银行账户</th>
					<th class="tR">账户余额</th>
					<th class="tR">授信余额</th>
				</tr>
			</thead>
			<thead>
				<tr>
				    <th class="tL">交易时间</th>
					<th>订单号</th>
					<th>交易内容</th>
					<th>交易方式</th>
					<th class="tR">收入</th>
					<th class="tR">银行账户</th>
					<th class="tR">账户余额</th>
					<th class="tR">授信余额</th>
				</tr>
			 </thead>
			  <tbody>
				<?foreach($r as $row){$i++;?>
				<tr class="<?=($i%2==1)?"odd":"even"?>">
					<td class="tL" title="<?=$row['id']?>"><?=$row['rectime']?></td>
					<td><a target="_blank" href="orderView.html?ordernum=<?=$row['orderid']?>"><?=$row['orderid']?></a></td>
					<td><?=$dtypeT[$row['dtype']]?$dtypeT[$row['dtype']]:$row['dtypeT']?></td>
					<td><?=$ptypeT[$row['ptype']]?></td>
					<td class="income pay tR"><?=$row['income']?><?=$row['pay']?></td>
					<td class="lmoney tR"><?=$row['alipay']?></td>
					<td class="lmoney tR"><?=($row['ptype']==0||$row['ptype']==1)?$row['lmoney']/100:""?></td>
					<td class="lmoney tR"><?=($row['ptype']==2||$row['ptype']==3)?($row['lmoney']/100)."</br>(".$dnames[$row['aid']].")":""?></td>
				</tr>
				<?}?>
				<?if(count($r)==0){?>
					<tr><td colspan="7" style="text-align:left; padding-left:60px;">无资金流向记录</td></tr>
				<?}?>
			</tbody>
		</table>
		<?if(count($r)!=0){page($count,$currentPage,$pageSize);}?>
	</div>
</div>
<script>
	$(".search li.time a").click(function(){
		var title=$(this).attr("title");
		Date_func.selectDate(title,document.getElementById("begintime"),document.getElementById("endtime"));
		$("#timeT").val(title)
		$("#searchBox").submit();
	})
	$(".search li.skey a").click(function(){
		var key=$(this).attr("key");
		$("#"+key).val($(this).attr("kvalue"));
		$("#searchBox").submit();
	})
</script>